{{- $version := index .Params 0 }}
{{- $inner := .Inner }}
{{- with (index $.Site.Data.jdk.versions $version) }}
<div style="overflow-x:auto;">
<table>
  <tbody>
    <tr>
      <th>Status</th>
      <td>{{ index $.Site.Data.jdk.status .status }}</td>
    </tr>
    <tr>
      <th>Release Date</th>
      <td>{{ .ga }}</td>
    </tr>
    <tr>
      <th>EOL Date</th>
      <td>{{ .eol }}</td>
    </tr>
    {{- with .latestversion }}
    <tr>
      <th>Latest Version</th>
      <td>{{ . }}</td>
    </tr>
    {{- end }}
    {{- with .codename }}
    <tr>
      <th>Codename</th>
      <td>{{ . }}</td>
    </tr>
    {{- end }}
    {{- with .umbrellajsr }}
    <tr>
      <th>Umbrella JSR</th>
      <td><a href="https://jcp.org/en/jsr/detail?id={{ . }}">JSR {{ . }}</a></td>
    </tr>
    {{- end }}    <tr>
      <th style="white-space: nowrap;">Class File Version</th>
      <td>{{ .bytecode }}</td>
    </tr>
    <tr>
      <th style="white-space: nowrap;">Unicode Version</th>
      <td><a href="https://www.unicode.org/versions/Unicode{{ .unicode }}/">{{ .unicode }}</a></td>
    </tr>
    {{- if .apidiff }}
    <tr>
      <th>API Changes</th>
      <td>
        Compare to
        {{ range $elem_index, $elem_val := (sort .apidiff "order" "desc") }}
          {{- if lt 0 $elem_index }} - {{ end -}}
          <a href="apidiff/{{ $elem_val.base.feature }}/">{{ $elem_val.base.feature }}</a>
        {{- end }}
      </td>
    </tr>
    {{- end }}
    <tr>
      <th>Documentation</th>
      <td>
        {{- with .documentation.notes }}
          <a href="{{ . }}">Release Notes</a>,
        {{- end }}
        {{- with .documentation.lang }}
          <a href="{{ . }}">Language Spec</a>,
        {{- end }}
        {{- with .documentation.vm }}
          <a href="{{ . }}">VM Spec</a>,
        {{- end }}
        {{- with .documentation.api }}
          <a href="{{ . }}">JavaDoc</a>
        {{- end }}
      </td>
    </tr>
    <tr>
      <th>SCM</th>
      <td>
        {{- range .scm }}
          <a href="{{ .url }}">{{ .type }}</a>
        {{- end }}
      </td>
    </tr>
  </tbody>
</table>

<div class="datasource">
  <a href="{{ $.Site.Params.Dataapibase }}jdk/versions/{{ $version }}">Data Source</a>
</div>
</div>

<div>
{{ $inner | markdownify }}
</div>

<h2>New Features</h2>

<p>
Here are all new features in {{ .name }} by category. There is also of list of <a href="../../features/">all features of all Java releases</a>.
</p>

{{- end }}

{{- $allfeatures := index (index $.Site.Data.jdk.versions $version) "features" }}
{{- range sort $.Site.Data.jdk.featurecategories "order" }}
  {{- $currenttitle := .title }}
  {{- with where $allfeatures "category" .id }}
    <h3>{{ $currenttitle }}</h3>
    <ul>
    {{- range . }}
      <li>
        {{ .title }}
        {{- if .incubator}} <span class="tag feature">{{ .revision }}. Incubator</span>{{ end -}}
        {{- if .preview}} <span class="tag feature">{{ .revision }}. Preview</span>{{ end -}}
        {{ with .refs }} ({{ range $idx, $item := . -}}
          {{ if gt $idx 0 }}, {{ end -}}
          {{ partial "featureref" $item }}
        {{- end }}){{ end }}
      </li>
    {{- end }}
    </ul>
  {{- end }}
{{- end }}

<h2>Should I Upgrade?</h2>

{{ partial "upgrade" $version }}

<h2>Downloads</h2>

<div style="overflow-x:auto;">
<table>
  <thead>
    <tr>
      <th>Vendor</th>
      <th>Product</th>
      <th>License</th>
      <th>Platform Downloads</th>
    </tr>
  </thead>
  <tbody>
  {{- range $.Page.Site.Data.jdk.vendors }}
    {{- $vendor := . }}
    {{- range .products }}
    {{- $product := . }}
    {{- if in .versions $version }}
    <tr>
      <td><a href="{{ $vendor.url }}">{{ $vendor.name }}</a></td>
      <td><a href="{{ .url }}">{{ .name }}</a></td>
      <td>{{ .license }}</td>
      <td>
        <ul class="tag architecture">
          {{- range .platforms }}
            {{- if $product.foojaydownload }}
              <li><a href="../download/#product={{ $product.id }}&version={{ $version }}&platform={{ . }}">{{ . }}</a></li>
            {{- else }}
              <li>{{ . }}</li>
            {{- end }}
          {{- end }}
        </ul>
      </td>
    </tr>
    {{- end }}
    {{- end }}
  {{- end }}
  </tbody>
</table>

<div class="datasource">
  <a href="{{ $.Site.Params.Dataapibase }}jdk/versions/{{ $version }}">Data Source</a>
</div>
</div>
